<?php

namespace Modules\Shop\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ArticleRequest extends FormRequest
{
    //验证规则
    public function rules()
    {
        return array (
        	'title'=>'required',
			'author'=>'required',
			'introduce'=>'required',
			'content'=>'required',
			'thumb'=>'required',
			'click'=>'required',
			'tag'=>'required'
);
    }

    //错误信息处理
    public function messages()
    {
        return array (
        	'title.required'=>'请填写文章标题',
			'author.required'=>'请填写作者',
			'introduce.required'=>'请填写简介',
			'content.required'=>'请填写文章内容',
			'thumb.required'=>'请选择缩略图',
			'click.required'=>'请填写点击数',
			'tag.required'=>'请至少选择一个标签'
);
    }

    //权限验证
    public function authorize()
    {
        return true;
    }
}
